<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--<button type="button" id="btn">点击跳转</button>

<script type="text/javascript">
    document.getElementById("btn").onclick= function  () {
        let param  = {
            name:"张三",
            age:"18",
            miaoshu:"张三的传奇一生"

        }
        window.location.href = "newIndex.html?name="+param.age
        // window.location.href = "newIndex.html?param="+param
    }
</script>-->


    <h1><a href="./newIndex.html">跳转</a>的页面</h1>

    <script>
        // 定义要传的参数
        const param = {
            name:'马东梅',
            age:'22',
            sex:'girl',
            position:'牛马帮马子哥',
            blogurl:'https://www.mazige.com'
        }
        /* //如果是多条数据加上这个数组JSON.stringify(param)改为JSON.stringify(array)
        var array = [];
        array.push(param); */
        const params = JSON.stringify(param); // 因为localStorage只能存字符串，所以需要转化成JSON 字符串。
        localStorage.setItem('params',params);
    </script>

</body>
</html>